<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>

		<title>Parceiros</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="css/style.css" type="text/css" rel="stylesheet" />
		<link href="css/obardavez.css" type="text/css" rel="stylesheet" />
		<link media="screen" type="text/css" href="css/bootstrap.min.css" rel="stylesheet">
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" ></script>
		<script src="scripts/jquery.easing.min.js" type="text/javascript"></script>
		<script src="scripts/jquery.lavalamp.min.js" type="text/javascript"></script>
		<script src="scripts/js.js" type="text/javascript"></script>
		<script type="text/javascript" language="javascript" src="scripts/modal-window.min.js"></script>
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
		<script src="scripts/jquery.maskedinput.js" type="text/javascript"></script>
		<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.6/jquery.validate.js" ></script>
		<script type="text/javascript" language="JavaScript"  src="scripts/jquery.i18n.properties-1.0.9.js"></script>
		<script type="text/javascript" src="scripts/init.js"></script>
		<script type="text/javascript" src="scripts/parceiro.js"></script>
		<script type="text/javascript" src="scripts/angular-1.0.1.min.js"></script>		
		
		<script type="text/javascript">  
		jQuery(function($){ 
		   $('#telefone').mask("(99) 9999-9999");
			$("#cnpj").mask("99.999.999/9999-99");		   
		}); 
		</script>
		
		<script>
		function validaCNPJ(ObjCnpj){
			var cnpj = ObjCnpj.value;
			var valida = new Array(6,5,4,3,2,9,8,7,6,5,4,3,2);
			var dig1= new Number;
			var dig2= new Number;
			
			exp = /\.|\-|\//g
			cnpj = cnpj.toString().replace( exp, "" ); 
			var digito = new Number(eval(cnpj.charAt(12)+cnpj.charAt(13)));
					
			for(i = 0; i<valida.length; i++){
					dig1 += (i>0? (cnpj.charAt(i-1)*valida[i]):0);  
					dig2 += cnpj.charAt(i)*valida[i];       
			}
			dig1 = (((dig1%11)<2)? 0:(11-(dig1%11)));
			dig2 = (((dig2%11)<2)? 0:(11-(dig2%11)));
			
			if(((dig1*10)+dig2) != digito){  
				alert('CNPJ Invalido!');
				ObjCnpj.focus();
			}
					
		}
		</script>


	</head>
	<body ng-app ng-controller="ParceiroCtrl">
	
		<div ng-include="'topo.html'"></div>

		<div class="centercolumn">
			<div class="bar-header">	
				<div class="obardavez-form">
					<form id="parceiroForm" action="#" method="post" >
						<section>
							<div class="title">
							  <h3>Cadastro</h3>
							  <p>Para divulgar sua marca no O Bar Da Vez 
								preencha o formulário abaixo.</p>
							</div>
							   <div class="fields-container">
								  <div class="grid-half-left">
										<div class="field empresa">
										  <label>Empresa</label>
										  <input ng-model="unidade.empresa" name="empresa" placeholder="Nome da empresa" size="30" type="text" value="" />
										</div>
								  </div>
								  
								  <div class="grid-half-right">
										<div class="field cnpj">
										  <label>CNPJ</label>
										  <input ng-model="unidade.cnpj" id="cnpj" name="cnpj" placeholder="99.999.999/9999-99" size="30" type="text" value="" onBlur="validaCNPJ(form.cnpj);"/>
										</div>
								  </div>
								  
								  <br clear="all" />
								  
								  <div class="grid-full">
										<div class="field contato">
										  <label>Contato</label>
										  <input ng-model="unidade.contato" name="contato" placeholder="Nome de um contato na empresa" size="30" type="text" value="" />
										</div>
								  </div>
								  
								  <br clear="all" />

								  <div class="grid-half-left">
										<div class="field email">
										  <label>E-mail</label>
										  <input ng-model="unidade.email" name="email" placeholder="contato@empresa.com" size="30" type="text" value="" />
										</div>
								  </div>
								  <div class="grid-half-right">
										<div class="field telephone">
										  <label>Telefone</label>
										  <input ng-model="unidade.telefone" id="telefone" name="telefone" placeholder="(00)0000-0000" size="30" type="text" value="" />
										</div>
								  </div>
								  <br clear="all" />
								  
								  <div class="grid-half-left">
										<div class="field url">
										  <label>Endereço na internet</label>
										  <input ng-model="unidade.url" name="url" placeholder="www.empresa.com.br" size="30" type="text" value="" />
										</div>
								  </div>
								  
								  <div class="grid-half-right">
										<div class="field logomarca">
										  <label>Logomarca</label>
										  <input ng-model="unidade.logomarca" name="logomarca" size="30" type="file" value=""/>
										</div>
								  </div>
								  <br clear="all" />
								  
								  <div class="grid-half-left">
										<div class="field plano">
										  <label>Plano de pagamento</label>
										  <select ng-model="unidade.plano" name="plano" 
												ng-options="plano.value as plano.displayName for plano in planos">
												<option value="">--- Selecione o plano de pagamento ---</option>
										  </select>
										</div>
								  </div>
								  
								  <div class="grid-half-right">
										<div class="field forma">
										  <label>Forma de pagamento</label>
										  <select ng-model="unidade.forma" name="forma" 
												ng-options="forma.value as forma.displayName for forma in formas">
												<option value="">--- Selecione a forma de pagamento ---</option>
										  </select>
										</div>
								  </div>
								  <br clear="all" />
								  Ao clicar no botão Enviar você confirma a aceitação dos <a href="termosdeuso.php"><u>termos de uso</u></a> do site.<br></br>
								  
								  <p></p>
								  
								  <input class="button" id="saveParceiro" type="submit" name="saveParceiro" value="Enviar" />
								</div>
						</section>
					</form>
				</div>									
			</div>
		</div>
		
		<div ng-include="'footer.html'"></div>
	</body>
</html>
